package liuyang.bigeventserver.modules.actuator;

import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.stereotype.Component;

/**
 *
 * management.endpoint.health.enabled=true
 * management.endpoint.health.show-details=always
 * 重启后访问
 * http://localhost:8080/actuator/health
 *
 * @author xconf
 * @since 2024/2/14
 */
@Component
public class FooHealth extends AbstractHealthIndicator {
    @Override
    protected void doHealthCheck(Health.Builder builder) throws Exception {
        // 自定义业务判断...

        // 返回health信息
        //builder.up().build();
        //builder.down().build();

        // 返回带信息的up
        builder.up().withDetail("foo", "活得好好地").build();
    }
}
